from lib.config.base import BaseConfig
from utils import common


class DeviceConfig(BaseConfig):
    def __init__(self, path):
        super().__init__(path)

    def get_version(self):
        return common.get_data_value(self.__config, "version") or "-"

    def get_reboot(self):
        return common.get_data_value(self.__config, "reboot") or 0

    def is_debug(self):
        debug = common.get_data_value(self.__config, "debug")
        return debug == 1

    def get_address(self):
        return common.get_data_value(self.__config, "address")

    def get_description(self):
        return common.get_data_value(self.__config, "description")

    def get_custom_value(self, key):
        return common.get_data_value(self.__config, key) or None
